


<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require_once ('db_conn.php');
require("function.php");

$sql="SELECT * FROM tb_newstype";
$xwas=$db->query($sql);
$xws=$xwas->fetch_all(MYSQLI_BOTH);


 $typeid=isset($_GET['id'])?$_GET['id']:-1;
    if ($typeid==-1)
       $sql="select a.*,b.typename from tb_news a,tb_newstype b  where a.typeid=b.id ";   //写新闻查询语句  
    else
       $sql="select a.*,b.typename from tb_news a,tb_newstype b  where a.typeid=b.id and a.typeid=$typeid";   //写新闻查询语句   
    $abs=$db->query($sql); //执行语句  $rs是一个结果集
    $abcs=$abs->fetch_all(MYSQLI_BOTH);   //包括所有行   */

require 'news.php';
$abs->free();


$db->close();
